<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="{:U('Index/index')}" data-original-title="首页"><i class="icon-home"></i> 首页</a>
			<a class="tip-bottom" href="{:U('Auth/index')}" data-original-title="">权限管理</a> <a class="current" href="{$post_url}">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
						<h5>{$meta_title}</h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" action="">
							<div class="control-group">
				              <label class="control-label">用户组</label>
				              <div class="controls">
				              	<volist name="auth_groups" id="vo">
									<label title="{$vo.description}"><span><input type="checkbox" name="group_id[]"  value="{$vo.id}" class="auth_groups"></span>{$vo.title}</label>
								</volist>
				              </div>
				            </div>
							<div class="form-actions">
								<button class="btn btn-success ajax-post" type="submit" target-form="form-horizontal" url="{:U('addMmeberToGroup')}">提交</button>
							</div>
							<input type="hidden" name="one_user" value="true">
							<input type="hidden" name="uid" value="{:I('uid')}">
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	/**
	 *@todo 已在的用户组默认选中
	 */
	var group = [{$user_groups}];
	$('.auth_groups').each(function(){
		if( $.inArray( parseInt(this.value,10),group )>-1 ){
			$(this).parent("span").addClass('checked');
			$(this).prop('checked',true);
		}
	});
    //导航高亮
	highlight_subnav("{:U('Auth/index')}");
});
</script>
</block>